#ifndef IMAGEFILETHUMB_H
#define IMAGEFILETHUMB_H
#include <QtCore/QFile>
#include <QtGui/QImage>
#include <QtCore/QDateTime>
#include <QtCore/QDataStream>
#include "Portability.h"

class ImageFileThumb
{
public:
	ImageFileThumb(const QString& absDirPath);
	~ImageFileThumb();

	void renameFile(const QString&);
	void setFileName(const QString&);
	void setThumbImage(const QImage& );

	QString absoluteFilePath() const;
	QString fileName() const;
	QImage image() const;
	bool isDirty() const;
	bool isValid() const;

	friend QDataStream& operator<<(QDataStream & stream,const ImageFileThumb&);
	friend QDataStream & operator>> ( QDataStream & stream, ImageFileThumb&);

private:
	const QString _dirPath;
	QString _fileName;
	qint64    _fileSize;
	QDateTime _lastModifyTime;
	QImage    _image;
};

#endif // IMAGEFILETHUMB_H
